package com.uuah.server.config.spring.parsers.processors;

import org.w3c.dom.Element;
import org.springframework.beans.factory.xml.ParserContext;

import com.uuah.server.config.spring.parsers.PostProcessor;
import com.uuah.server.config.spring.parsers.PreProcessor;
import com.uuah.server.config.spring.parsers.assembly.IBeanAssembler;
import com.uuah.server.config.spring.parsers.assembly.configuration.IPropertyConfiguration;

public class AddAttribute implements PreProcessor, PostProcessor {

	private String name;
	private String value;

	public AddAttribute(String name, String value) {
		this.name = name;
		this.value = value;
	}

	public void postProcess(ParserContext unused, IBeanAssembler assembler,
			Element element) {
		element.setAttribute(name, value);
	}

	public void preProcess(IPropertyConfiguration config, Element element) {
		element.setAttribute(name, value);
	}

}
